Optimal. Leaf size=22 \[ \sec (x)+\frac {1}{2} i \tanh ^{-1}(\sin (x))-\frac {1}{2} i \tan (x) \sec (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.15, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.538, Rules used = {3518, 3108, 3107, 2606, 8, 2611, 3770} \[ \sec (x)+\frac {1}{2} i \tanh ^{-1}(\sin (x))-\frac {1}{2} i \tan (x) \sec (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2606
Rule 2611
Rule 3107
Rule 3108
Rule 3518
Rule 3770
Rubi steps
\begin {align*} \int \frac {\sec ^3(x)}{i+\cot (x)} \, dx &=-\int \frac {\sec ^2(x) \tan (x)}{-\cos (x)-i \sin (x)} \, dx\\ &=i \int \sec ^2(x) (-i \cos (x)-\sin (x)) \tan (x) \, dx\\ &=i \int \left (-i \sec (x) \tan (x)-\sec (x) \tan ^2(x)\right ) \, dx\\ &=-\left (i \int \sec (x) \tan ^2(x) \, dx\right )+\int \sec (x) \tan (x) \, dx\\ &=-\frac {1}{2} i \sec (x) \tan (x)+\frac {1}{2} i \int \sec (x) \, dx+\operatorname {Subst}(\int 1 \, dx,x,\sec (x))\\ &=\frac {1}{2} i \tanh ^{-1}(\sin (x))+\sec (x)-\frac {1}{2} i \sec (x) \tan (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.15, size = 48, normalized size = 2.18 \[ -\frac {1}{2} i \left ((\tan (x)+2 i) \sec (x)+\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.62, size = 73, normalized size = 3.32 \[ \frac {{\left (i \, e^{\left (4 i \, x\right )} + 2 i \, e^{\left (2 i \, x\right )} + i\right )} \log \left (e^{\left (i \, x\right )} + i\right ) + {\left (-i \, e^{\left (4 i \, x\right )} - 2 i \, e^{\left (2 i \, x\right )} - i\right )} \log \left (e^{\left (i \, x\right )} - i\right ) + 2 \, e^{\left (3 i \, x\right )} + 6 \, e^{\left (i \, x\right )}}{2 \, {\left (e^{\left (4 i \, x\right )} + 2 \, e^{\left (2 i \, x\right )} + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.41, size = 55, normalized size = 2.50 \[ -\frac {i \, \tan \left (\frac {1}{2} \, x\right )^{3} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + i \, \tan \left (\frac {1}{2} \, x\right ) - 2}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )}^{2}} + \frac {1}{2} i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) + 1\right ) - \frac {1}{2} i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) - 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.39, size = 84, normalized size = 3.82 \[ -\frac {i \ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{2}-\frac {i}{2 \left (\tan \left (\frac {x}{2}\right )-1\right )^{2}}-\frac {1}{\tan \left (\frac {x}{2}\right )-1}-\frac {i}{2 \left (\tan \left (\frac {x}{2}\right )-1\right )}+\frac {i}{2 \left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}+\frac {i \ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{2}+\frac {1}{\tan \left (\frac {x}{2}\right )+1}-\frac {i}{2 \left (\tan \left (\frac {x}{2}\right )+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.48, size = 94, normalized size = 4.27 \[ \frac {\frac {i \, \sin \relax (x)}{\cos \relax (x) + 1} + \frac {2 \, \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + \frac {i \, \sin \relax (x)^{3}}{{\left (\cos \relax (x) + 1\right )}^{3}} - 2}{\frac {2 \, \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} - \frac {\sin \relax (x)^{4}}{{\left (\cos \relax (x) + 1\right )}^{4}} - 1} + \frac {1}{2} i \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right ) - \frac {1}{2} i \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.30, size = 47, normalized size = 2.14 \[ \mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,1{}\mathrm {i}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3\,1{}\mathrm {i}+2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+\mathrm {tan}\left (\frac {x}{2}\right )\,1{}\mathrm {i}-2}{{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right )}^2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec ^{3}{\relax (x )}}{\cot {\relax (x )} + i}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________